package com.bckj.fastboot.flow.configuration;

import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FlowProcessEngineConfiguration implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {

    private final FlowDataSource flowDataSource;

    public FlowProcessEngineConfiguration(FlowDataSource flowDataSource) {
        this.flowDataSource = flowDataSource;
    }

    @Override
    public void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration) {
        // advanced configuration
        springProcessEngineConfiguration.setDataSource(flowDataSource.dataSource());
    }

}
